package cn.kai.ums.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 
 * @TableName ums_public_course
 */
@TableName(value ="ums_public_course")
@Data
public class UmsPublicCourse implements Serializable {
    /**
     * 选修课课自增id
     */
    @TableId(type = IdType.AUTO)
    private Integer publicCourseId;

    /**
     * 选修课编号，SL+4位数字
     */
    private String publicCourseNo;

    /**
     * 选修课名称
     */
    private String publicCourseName;

    /**
     * 选修课专业编号（若有则为本专业选修课若无则为公共选修课）
     */
    private String publicCourseSpecialNo;

    /**
     * 学期信息（年份+第几个学期）
     */
    private String publicCourseTermid;

    /**
     * 课程学分
     */
    private Double classCourseCourseScore;

    /**
     * 选修课人数
     */
    private Integer publicCourseNum;

    /**
     * 选修课开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date publicCourseStart;

    /**
     * 选修课结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date publicCourseEnd;

    @TableField(exist = false)
    private List<UmsPublicCourseTeach> umsPublicCourseTeachList;



    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UmsPublicCourse other = (UmsPublicCourse) that;
        return (this.getPublicCourseId() == null ? other.getPublicCourseId() == null : this.getPublicCourseId().equals(other.getPublicCourseId()))
            && (this.getPublicCourseNo() == null ? other.getPublicCourseNo() == null : this.getPublicCourseNo().equals(other.getPublicCourseNo()))
            && (this.getPublicCourseName() == null ? other.getPublicCourseName() == null : this.getPublicCourseName().equals(other.getPublicCourseName()))
            && (this.getPublicCourseSpecialNo() == null ? other.getPublicCourseSpecialNo() == null : this.getPublicCourseSpecialNo().equals(other.getPublicCourseSpecialNo()))
            && (this.getPublicCourseTermid() == null ? other.getPublicCourseTermid() == null : this.getPublicCourseTermid().equals(other.getPublicCourseTermid()))
            && (this.getClassCourseCourseScore() == null ? other.getClassCourseCourseScore() == null : this.getClassCourseCourseScore().equals(other.getClassCourseCourseScore()))
            && (this.getPublicCourseNum() == null ? other.getPublicCourseNum() == null : this.getPublicCourseNum().equals(other.getPublicCourseNum()))
            && (this.getPublicCourseStart() == null ? other.getPublicCourseStart() == null : this.getPublicCourseStart().equals(other.getPublicCourseStart()))
            && (this.getPublicCourseEnd() == null ? other.getPublicCourseEnd() == null : this.getPublicCourseEnd().equals(other.getPublicCourseEnd()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPublicCourseId() == null) ? 0 : getPublicCourseId().hashCode());
        result = prime * result + ((getPublicCourseNo() == null) ? 0 : getPublicCourseNo().hashCode());
        result = prime * result + ((getPublicCourseName() == null) ? 0 : getPublicCourseName().hashCode());
        result = prime * result + ((getPublicCourseSpecialNo() == null) ? 0 : getPublicCourseSpecialNo().hashCode());
        result = prime * result + ((getPublicCourseTermid() == null) ? 0 : getPublicCourseTermid().hashCode());
        result = prime * result + ((getClassCourseCourseScore() == null) ? 0 : getClassCourseCourseScore().hashCode());
        result = prime * result + ((getPublicCourseNum() == null) ? 0 : getPublicCourseNum().hashCode());
        result = prime * result + ((getPublicCourseStart() == null) ? 0 : getPublicCourseStart().hashCode());
        result = prime * result + ((getPublicCourseEnd() == null) ? 0 : getPublicCourseEnd().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", publicCourseId=").append(publicCourseId);
        sb.append(", publicCourseNo=").append(publicCourseNo);
        sb.append(", publicCourseName=").append(publicCourseName);
        sb.append(", publicCourseSpecialNo=").append(publicCourseSpecialNo);
        sb.append(", publicCourseTermid=").append(publicCourseTermid);
        sb.append(", classCourseCourseScore=").append(classCourseCourseScore);
        sb.append(", publicCourseNum=").append(publicCourseNum);
        sb.append(", publicCourseStart=").append(publicCourseStart);
        sb.append(", publicCourseEnd=").append(publicCourseEnd);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}